package u1.Text;


import novelRead.Client.MenuClient;
import novelRead.Client.NovelReadClient;
import novelRead.common.*;

import java.net.Socket;
import java.util.ArrayList;
import java.util.Scanner;

public class Text {
    private static Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        Socket clientSocket = NovelReadClient.startNovel("127.0.0.1", 9090);
        User user = null;
        Response response = null;
        int n = 0;
        //调用登录菜单
        menu:
        while (true) {
            boolean login = MenuClient.login(user, response);//调用功能菜单
            while (login) {
                System.out.println("1.展示小说分类");
                System.out.println("2.上传小说");
                System.out.println("3.返回上一级");
                n = in.nextInt();
                switch (n) {
                    case 1:
                        MenuClient.menuType(user, response);//调用小说阅读菜单
                        break ;
                    case 2:
                        MenuClient.uploadMenu();//调用上传菜单
                        break ;
                    case 3:
                        continue menu;
                    default:
                        return;
                }
            }
        }
    }
}
